package com.ny.demo2;

public class Laptop {
    public void run(){
        System.out.println("笔记本运行");
    }
    public void shutdown(){
        System.out.println("笔记本关机");
    }
    public void useUSB(USB usb){
        usb.open();
        if (usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.click();
        }else if (usb instanceof Keyboard){
            Keyboard keyboard = (Keyboard) usb;
            keyboard.strike();
        }
        usb.close();
    }
}
